<template>
  <div class="icon-test">
    <h2>图标测试页面</h2>
    <div class="icon-grid">
      <div class="icon-item">
        <el-icon size="40"><Monitor /></el-icon>
        <p>Monitor</p>
      </div>
      <div class="icon-item">
        <el-icon size="40"><User /></el-icon>
        <p>User</p>
      </div>
      <div class="icon-item">
        <el-icon size="40"><DataBoard /></el-icon>
        <p>DataBoard</p>
      </div>
      <div class="icon-item">
        <el-icon size="40"><Document /></el-icon>
        <p>Document</p>
      </div>
      <div class="icon-item">
        <el-icon size="40"><Setting /></el-icon>
        <p>Setting</p>
      </div>
      <div class="icon-item">
        <el-icon size="40"><House /></el-icon>
        <p>House</p>
      </div>
    </div>
    
    <div class="test-info">
      <h3>测试信息</h3>
      <p>如果您能看到上面的图标，说明图标库工作正常。</p>
      <p>如果看不到某些图标，说明该图标名称不存在。</p>
      <el-button @click="goBack">返回</el-button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import {
  Monitor,
  User,
  DataBoard,
  Document,
  Setting,
  House
} from '@element-plus/icons-vue'

const router = useRouter()

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.icon-test {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.icon-item {
  text-align: center;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.icon-item p {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.test-info {
  margin-top: 40px;
  padding: 20px;
  background: #f0f9ff;
  border-radius: 8px;
  border: 1px solid #0ea5e9;
}

.test-info h3 {
  color: #0369a1;
  margin-bottom: 10px;
}

.test-info p {
  color: #0c4a6e;
  margin: 5px 0;
}
</style>
